package com.nnnu.orange.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nnnu.orange.pojo.dto.BorrowingQueryDto;
import com.nnnu.orange.pojo.entity.Borrowings;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nnnu.orange.pojo.vo.BorrowingQueryVO;
import com.nnnu.orange.pojo.vo.BorrowingVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 记录用户借阅图书的信息 Mapper 接口
 * </p>
 *
 * @author zk
 * @since 2024-11-07
 */
@Mapper
public interface BorrowingsMapper extends BaseMapper<Borrowings> {

    /**
     * 分页查询借阅记录数据
     *
     * @param queryDto dto
     * @return 分页后的数据
     */
    Page<BorrowingQueryVO> selectPageList(Page<?> page, BorrowingQueryDto queryDto);

    BorrowingVO selectByBorrowingId(Integer borrowingId);


    List<Integer> selectUsersInBorrowings(@Param("userIds") List<Integer> userIds);


}
